.class public Lrexsee/keyboard/RexseeTouchBall;
.super Ljava/lang/Object;
.source "RexseeTouchBall.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final DIRECTION_DOWN:I = 0x1

.field public static final DIRECTION_LEFT:I = 0x2

.field public static final DIRECTION_NONE:I = -0x1

.field public static final DIRECTION_RIGHT:I = 0x3

.field public static final DIRECTION_UP:I = 0x0

.field public static final EVENT_ONTOUCHBALLDISMISSED:Ljava/lang/String; = "onTouchBallDismissed"

.field public static final EVENT_ONTOUCHBALLMOVE:Ljava/lang/String; = "onTouchBallMove"

.field private static final INTERFACE_NAME:Ljava/lang/String; = "TouchBall"


# instance fields
.field private mBallDialog:Lrexsee/keyboard/TouchBallDialog;

.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 40
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 37
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    .line 41
    iput-object p1, p0, Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;

    .line 42
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mContext:Landroid/content/Context;

    .line 43
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTouchBallMove"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 44
    iget-object v0, p1, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onTouchBallDismissed"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 45
    return-void
.end method

.method static synthetic access$0(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 36
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/keyboard/RexseeTouchBall;Lrexsee/keyboard/TouchBallDialog;)V
    .locals 0

    .prologue
    .line 37
    iput-object p1, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    return-void
.end method

.method static synthetic access$2(Lrexsee/keyboard/RexseeTouchBall;)Lrexsee/keyboard/TouchBallDialog;
    .locals 1

    .prologue
    .line 37
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    return-object v0
.end method


# virtual methods
.method public dismiss()V
    .locals 1

    .prologue
    .line 159
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    if-nez v0, :cond_0

    .line 162
    :goto_0
    return-void

    .line 160
    :cond_0
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    invoke-virtual {v0}, Lrexsee/keyboard/TouchBallDialog;->dismiss()V

    .line 161
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    goto :goto_0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 19
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 15
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/keyboard/RexseeTouchBall;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "TouchBall"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 23
    new-instance v0, Lrexsee/keyboard/RexseeKeyboard;

    invoke-direct {v0, p1}, Lrexsee/keyboard/RexseeKeyboard;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public getStyle(Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 169
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    if-nez v0, :cond_0

    const-string v0, ""

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    invoke-virtual {v0, p1}, Lrexsee/keyboard/TouchBallDialog;->getStyle(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public setStyle(Ljava/lang/String;)V
    .locals 1
    .param p1, "style"    # Ljava/lang/String;

    .prologue
    .line 165
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    if-nez v0, :cond_0

    .line 167
    :goto_0
    return-void

    .line 166
    :cond_0
    iget-object v0, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    invoke-virtual {v0, p1}, Lrexsee/keyboard/TouchBallDialog;->setStyle(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 9
    .param p1, "style"    # Ljava/lang/String;
    .param p2, "ball"    # Ljava/lang/String;
    .param p3, "background"    # Ljava/lang/String;

    .prologue
    const/4 v4, -0x1

    .line 49
    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move v5, v4

    move v6, v4

    move v7, v4

    move v8, v4

    invoke-virtual/range {v0 .. v8}, Lrexsee/keyboard/RexseeTouchBall;->show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIIII)V

    .line 50
    return-void
.end method

.method public show(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIIII)V
    .locals 7
    .param p1, "style"    # Ljava/lang/String;
    .param p2, "ball"    # Ljava/lang/String;
    .param p3, "background"    # Ljava/lang/String;
    .param p4, "upKeycode"    # I
    .param p5, "downKeycode"    # I
    .param p6, "leftKeycode"    # I
    .param p7, "rightKeycode"    # I
    .param p8, "accuracy"    # I

    .prologue
    .line 52
    iget-object v1, p0, Lrexsee/keyboard/RexseeTouchBall;->mBallDialog:Lrexsee/keyboard/TouchBallDialog;

    if-eqz v1, :cond_0

    .line 157
    .end local p4    # "upKeycode":I
    :goto_0
    return-void

    .line 54
    .restart local p4    # "upKeycode":I
    :cond_0
    if-gez p8, :cond_1

    .line 55
    new-instance v0, Lrexsee/keyboard/RexseeTouchBall$1;

    invoke-direct {v0, p0}, Lrexsee/keyboard/RexseeTouchBall$1;-><init>(Lrexsee/keyboard/RexseeTouchBall;)V

    .line 143
    .local v0, "listener":Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;
    :goto_1
    move-object v6, v0

    .line 144
    .local v6, "onTouchBallMoveListener":Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;
    iget-object p4, p0, Lrexsee/keyboard/RexseeTouchBall;->mContext:Landroid/content/Context;

    .end local p4    # "upKeycode":I
    check-cast p4, Landroid/app/Activity;

    new-instance v1, Lrexsee/keyboard/RexseeTouchBall$3;

    move-object v2, p0

    move-object v3, p1

    move-object v4, p2

    move-object v5, p3

    invoke-direct/range {v1 .. v6}, Lrexsee/keyboard/RexseeTouchBall$3;-><init>(Lrexsee/keyboard/RexseeTouchBall;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;)V

    invoke-virtual {p4, v1}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V

    goto :goto_0

    .line 62
    .end local v0    # "listener":Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;
    .end local v6    # "onTouchBallMoveListener":Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;
    .restart local p4    # "upKeycode":I
    :cond_1
    new-instance v0, Lrexsee/keyboard/RexseeTouchBall$2;

    move-object v1, p0

    move v2, p4

    move v3, p5

    move v4, p6

    move v5, p7

    move v6, p8

    invoke-direct/range {v0 .. v6}, Lrexsee/keyboard/RexseeTouchBall$2;-><init>(Lrexsee/keyboard/RexseeTouchBall;IIIII)V

    .restart local v0    # "listener":Lrexsee/keyboard/TouchBallWidget$OnTouchBallMoveListener;
    goto :goto_1
.end method
